package com.luguangtao.dao;

import com.luguangtao.entity.Menu;
import com.luguangtao.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;

public interface MenuDao extends JpaRepository<Menu,Integer> {

    @Modifying
    @Transactional
    @Query(value = "delete from jpa_role_menu where menuid = ?1",nativeQuery = true)
    List<Menu> delAll(Integer menuid);
}
